<?php
include('rootlogin.php');
//include('../../incsession.php');
session_start();
$level=3;
if(!isset($_POST['video_intro'])){
			$flag=0;
}
else if($_POST['video_intro'] == '' || $_POST['video_intro'] == ' '){
			$flag=1;	
}
else{
	
	
	$intro = str_replace("'", "&#39;", $_POST['video_intro']);
	$intro = str_replace('"', '&quot;', $intro);
	$query = "UPDATE video SET intro='".$intro."'    
				WHERE topicid=".$_SESSION['topic']." AND level=".$level;
	$result = mysql_query($query,$user_con) or die('<font color="#C11B17">Error. Please go back to the previous page and try again.</font>');	
	header ("location: page.php");
}
?>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../framestyle.css" type="text/css" media="screen">
</head>

<body>
<div id="wrapper">
<div id="title">Online Listening Comprehension Program</div>

<div id="main">
<hr/>
<div id="title2">FOR DIFFICULT LEVEL: INTRO TO THE VIDEO</div>
<hr/>
<br><br>
<?php
	if($flag==1){
		echo "<div id='error'>Please fill in all the column.</div><br>";
	}
?>
<form method = POST action="video_intro3.php" >


introduction to the video:<br>
<?php
	
	
	
	$query="SELECT * FROM video WHERE topicid=".$_SESSION['topic']." AND level=".$level;
	$result = mysql_query($query,$user_con);
	$row = mysql_fetch_array($result);
	echo '<textarea name="video_intro" rows=12 cols=119>'.$row['intro'].'</textarea>';
?>
<br><br>
<div class="btn_right"><input type="submit" name = "next" value = "submit"></div>

</form>


</div>
</div>

</body>

